/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mk_tools;

import java.awt.GridLayout;
import javax.swing.*;

/**
 *
 * @author Mikael Köhlmyr, 2009
 */
public class Slicer {

    public int width;
    public int height;
    public JFrame window;
    public JPanel panel;
    public JMenuBar menubar;
    public JMenu actions;
    public JMenuItem newrect;
    public SlicerCanvas canvas;

    Slicer() {
        width = 644; //+4
        height = 522; //+48
        initiate();
    }

    private void initiate() {
        window = new JFrame("Slicer");
        window.setBounds(0, 0, width, height);

        window.setResizable(false);
        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        panel = new JPanel();
        canvas = new SlicerCanvas(width, height);
        panel.add(canvas);
        panel.setLayout(new GridLayout(1,1));
        window.add(panel);

        menubar = new JMenuBar();
        actions = new JMenu();
        newrect = new JMenuItem();
        actions.setText("Actions");
        newrect.setText("New box");

        window.setJMenuBar(menubar);
        menubar.add(actions);
        actions.add(newrect);

        //canvas.setBackground(Color.red);
        window.setVisible(true);
        canvas.graphics();
    }
}
